﻿model Model2
  Modelica.Electrical.Analog.Basic.Resistor resistor(R=20000) 
    annotation (Placement(transformation(origin={24,32}, 
extent={{-10,-10},{10,10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.Capacitor capacitor(C=1e-7) 
    annotation (Placement(transformation(origin={-6,-26}, 
extent={{-10,-10},{10,10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.Inductor inductor(L=0.00002) 
    annotation (Placement(transformation(origin={64,48}, 
extent={{-10,-10},{10,10}}, 
rotation=90)));
  Modelica.Electrical.Analog.Semiconductors.NPN npn(Bf=300) 
    annotation (Placement(transformation(origin={54,8}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Basic.Resistor resistor1(R=20000) 
    annotation (Placement(transformation(origin={24,-26}, 
extent={{-10,-10},{10,10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.Resistor resistor2(R=2200) 
    annotation (Placement(transformation(origin={64,-26}, 
extent={{-10,-10},{10,10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.Capacitor capacitor1(C=1e-8) 
    annotation (Placement(transformation(origin={90,-26}, 
extent={{-10,-10},{10,10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.Ground ground 
    annotation (Placement(transformation(origin={64,-64}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Basic.Capacitor capacitor2(C=1e-8) 
    annotation (Placement(transformation(origin={90,20}, 
extent={{-10,-10},{10,10}}, 
rotation=90)));
  Modelica.Electrical.Analog.Sources.SupplyVoltage supplyVoltage(Vps=15,Vns=-9) 
    annotation (Placement(transformation(origin={-66,-54}, 
extent={{-10,10},{10,-10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Sensors.VoltageSensor voltageSensor 
    annotation (Placement(transformation(origin={204,-4}, 
extent={{-10,-10},{10,10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.OpAmpDetailed opAmp1(Rdm=2.0e8,Rout=20,sr_p=0.5e8,sr_m=0.5e8) 
    annotation (Placement(transformation(origin={399,-10}, 
extent={{-10,10},{10,-10}})));
  Modelica.Electrical.Analog.Basic.Resistor resistor5(R=1000) 
    annotation (Placement(transformation(origin={381,-36}, 
extent={{-10,10},{10,-10}}, 
rotation=90)));
  Modelica.Electrical.Analog.Basic.Resistor resistor6(R=225000) 
    annotation (Placement(transformation(origin={347,-4}, 
extent={{-10,10},{10,-10}}, 
rotation=-180)));
  Modelica.Electrical.Analog.Basic.Resistor resistor7(R=10000) 
    annotation (Placement(transformation(origin={399,24}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Sources.SupplyVoltage supplyVoltage1 
    annotation (Placement(transformation(origin={429,-38}, 
extent={{10,-10},{-10,10}}, 
rotation=-180)));
  Modelica.Electrical.Analog.Sensors.VoltageSensor Vout 
    annotation (Placement(transformation(origin={492,-10}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Basic.Capacitor capacitor3(C=1e-9) 
    annotation (Placement(transformation(origin={451,-10}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Basic.Resistor resistor8(R=100000) 
    annotation (Placement(transformation(origin={471,-32}, 
extent={{-10,10},{10,-10}}, 
rotation=-90)));
  Modelica.Electrical.Analog.Basic.OpAmp opAmp2 
    annotation (Placement(transformation(origin={293,-4}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Sensors.VoltageSensor voltageSensor2 if false 
    annotation (Placement(transformation(origin={333,-30}, 
extent={{-10,-10},{10,10}})));
  Modelica.Electrical.Analog.Sources.SupplyVoltage supplyVoltage2 
    annotation (Placement(transformation(origin={283,-36}, 
extent={{-10,-10},{10,10}})));
  annotation(Diagram(coordinateSystem(extent={{-100,-100},{100,100}}, 
grid={2,2})));
equation
  connect(resistor.n, resistor1.p) 
  annotation(Line(origin={24,7}, 
points={{0,15},{0,-23}}, 
color={0,0,255}));
  connect(npn.B, resistor1.p) 
  annotation(Line(origin={34,-4}, 
  points={{10,12},{-10,12},{-10,-12}}, 
  color={0,0,255}));
  connect(npn.E, resistor2.p) 
  annotation(Line(origin={69,-7}, 
points={{-5,9},{-5,-9}}, 
color={0,0,255}));
  connect(npn.E, capacitor1.p) 
  annotation(Line(origin={77,2}, 
points={{-13,0},{13,0},{13,-18}}, 
color={0,0,255}));
  connect(ground.p, resistor2.n) 
  annotation(Line(origin={74,-42}, 
points={{-10,-12},{-10,6}}, 
color={0,0,255}));
  connect(supplyVoltage.ground, ground.p) 
  annotation(Line(origin={4,-55}, 
points={{-70,1},{60,1}}, 
color={0,0,255}));
  connect(supplyVoltage.pin_p, resistor.p) 
  annotation(Line(origin={-21,3}, 
points={{-45,-47},{-45,59},{45,59},{45,39}}, 
color={0,0,255}));
  connect(resistor1.n, ground.p) 
  annotation(Line(origin={44,-45}, 
  points={{-20,9},{-20,-9},{20,-9}}, 
  color={0,0,255}));
  connect(inductor.p, npn.C) 
  annotation(Line(origin={64,23}, 
points={{0,15},{0,-9}}, 
color={0,0,255}));
  connect(inductor.n, resistor.p) 
  annotation(Line(origin={44,47}, 
points={{20,11},{20,15},{-20,15},{-20,-5}}, 
color={0,0,255}));
  connect(capacitor1.n, ground.p) 
  annotation(Line(origin={77,-45}, 
points={{13,9},{13,-9},{-13,-9}}, 
color={0,0,255}));
  connect(capacitor1.p, capacitor2.p) 
  annotation(Line(origin={90,-3}, 
  points={{0,-13},{0,13}}, 
  color={0,0,255}));
  connect(capacitor2.n, inductor.p) 
  annotation(Line(origin={77,34}, 
points={{13,-4},{13,4},{-13,4}}, 
color={0,0,255}));
  connect(voltageSensor.n, ground.p) 
  annotation(Line(origin={97,-31}, 
points={{107,17},{107,-23},{-33,-23}}, 
color={0,0,255}));
  connect(capacitor.p, resistor1.p) 
  annotation(Line(origin={9,-16}, 
points={{-15,3.55271e-15},{-15,24},{15,24},{15,0}}, 
color={0,0,255}));
  connect(capacitor.n, ground.p) 
  annotation(Line(origin={29,-45}, 
  points={{-35,9},{-35,-9},{35,-9}}, 
  color={0,0,255}));
  connect(resistor5.n, opAmp1.p) 
  annotation(Line(origin={509,-10}, 
points={{-128,-16},{-128,6},{-120,6}}, 
color={0,0,255}));
  connect(resistor6.p, opAmp1.m) 
  annotation(Line(origin={381,-25}, 
points={{-24,21},{-19,21},{-19,9},{8,9}}, 
color={0,0,255}));
  connect(resistor7.n, opAmp1.outp) 
  annotation(Line(origin={409,4}, 
  points={{0,20},{10,20},{10,-14},{0,-14}}, 
  color={0,0,255}));
  connect(supplyVoltage1.pin_p, opAmp1.p_supply) 
  annotation(Line(origin={409,-32}, 
  points={{10,-6},{-10,-6},{-10,12}}, 
  color={0,0,255}));
  connect(opAmp1.m_supply, supplyVoltage1.pin_n) 
  annotation(Line(origin={419,-22}, 
  points={{-20,22},{-20,26},{32,26},{32,-16},{20,-16}}, 
  color={0,0,255}));
  connect(Vout.p, capacitor3.n) 
  annotation(Line(origin={469,-16}, 
points={{13,6},{-8,6}}, 
color={0,0,255}));
  connect(opAmp1.outp, capacitor3.p) 
  annotation(Line(origin={422,-16}, 
  points={{-13,6},{19,6}}, 
  color={0,0,255}));
  connect(resistor8.p, capacitor3.n) 
  annotation(Line(origin={462,-18}, 
  points={{9,-4},{9,8},{-1,8}}, 
  color={0,0,255}));
  connect(opAmp2.out, opAmp2.in_n) 
  annotation(Line(origin={293,-1}, 
  points={{10,-3},{30,-3},{30,33},{-30,33},{-30,3},{-10,3}}, 
  color={0,0,255}));
  connect(opAmp2.out, voltageSensor2.p) 
  annotation(Line(origin={322,-4}, 
  points={{-19,0},{1,0},{1,-26}}, 
  color={0,0,255}));
  connect(supplyVoltage2.pin_n, opAmp2.VMin) 
  annotation(Line(origin={293,-25}, 
  points={{0,-11},{0,11}}, 
  color={0,0,255}));
  connect(supplyVoltage2.pin_p, opAmp2.VMax) 
  annotation(Line(origin={283,-15}, 
  points={{-10,-21},{-10,21},{10,21}}, 
  color={0,0,255}));
  connect(supplyVoltage2.ground, ground.p) 
  annotation(Line(origin={174,-45}, 
  points={{109,9},{109,-9},{-110,-9}}, 
  color={0,0,255}));
  connect(voltageSensor2.n, supplyVoltage2.ground) 
  annotation(Line(origin={313,-43}, 
points={{30,13},{30,-11},{-30,-11},{-30,7}}, 
color={0,0,255}));
  connect(opAmp2.in_p, voltageSensor.p) 
  annotation(Line(origin={244,-2}, 
points={{39,-8},{-8,-8},{-8,8},{-40,8}}, 
color={0,0,255}));
  connect(supplyVoltage1.ground, supplyVoltage2.ground) 
  annotation(Line(origin={356,-37}, 
points={{73,-1},{73,-17},{-73,-17},{-73,1}}, 
color={0,0,255}));
  connect(resistor5.p, supplyVoltage2.ground) 
  annotation(Line(origin={332,-45}, 
  points={{49,-1},{49,-9},{-49,-9},{-49,9}}, 
  color={0,0,255}));
  connect(resistor8.n, supplyVoltage1.ground) 
  annotation(Line(origin={450,-40}, 
points={{21,-2},{21,-14},{-21,-14},{-21,2}}, 
color={0,0,255}));
  connect(resistor7.p, resistor6.p) 
  annotation(Line(origin={377,10}, 
points={{12,14},{-15,14},{-15,-14},{-20,-14}}, 
color={0,0,255}));
  connect(resistor6.n, opAmp2.out) 
  annotation(Line(origin={320,-4}, 
  points={{17,0},{-17,0}}, 
  color={0,0,255}));
  connect(inductor.p, voltageSensor.p) 
  annotation(Line(origin={134,22}, 
  points={{-70,16},{70,16},{70,-16}}, 
  color={0,0,255}));
  connect(Vout.n, supplyVoltage1.ground) 
  annotation(Line(origin={464,-24}, 
points={{38,14},{38,-30},{-35,-30},{-35,-14}}, 
color={0,0,255}));
  end Model2;